<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>

    <title>订单管理</title>
    <link href="${pageContext.request.contextPath }/css/admin/common.css" type="text/css" rel="stylesheet">
    <style type="text/css">
        table{
            text-align: center;
            border-collapse: collapse
        }
        .bgcolor{
              background-color: #F08080;
        }
    </style>
    <style type="text/css">
        table{
            text-align: center;
            border-collapse: collapse;
        }
        .bgcolor{
              background-color: #F08080;
        }
    </style>
    <style type="text/css">
    table{
        border-color:green;
        margin-left:20px;
        margin-top:20px;
        width:600px;
    }
    table tr td{
        padding:10px 5px;
        font-size: 12px;    
    }
    table tr:nth-child(odd){
        background-color: #eee;
        font-size:12px;
    }
    table tr td input[type=submit],table tr td input[type=reset]{width:137px;height:35px; background:url(images/btnbg.png) no-repeat; font-size:14px;font-weight:bold;color:#fff; cursor:pointer;}
    table tr td input[type=text]{width:345px; height:25px; line-height:25px; border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df;text-indent:10px;}
    select{width:105px; height:25px; line-height:25px; border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df;text-indent:10px;}
    table tr td:first-child{padding-left:23px;line-height:25px; font-weight: bold;text-align: center;}
    table tr th{height:50px;}
    form{margin-left:20px;margin-top:20px;}
    input[type=submit]{width:60px;margin-left:20px;}
    
</style>

    <script type="text/javascript">
    var tempName="";
    function changeColor(obj){
        tempName=obj.style.backgroundColor;
        //obj.className = "bgcolor";
        obj.style.backgroundColor="#F08080";
    }
    function changeColor1(obj){
        obj.style.backgroundColor=tempName;
    }
        function checkDel(id){
              if(window.confirm("是否删除该订单？")){
                  window.location.href="${pageContext.request.contextPath }/adminOrder/deleteorderManager?id="+id;
              }
          }
    </script>
</head>
<body>
    <br>
    <table border="1" bordercolor="PaleGreen">
        <tr>
            <th width="150px">订单编号</th>
            <th width="150px">用户E-mail</th>
            <th width="100px">订单金额</th>
            <th width="100px">订单状态</th>
            <th width="150px">订单日期</th>
            <th width="100px">操作</th>
        </tr>
        <c:forEach var="n" items="${orderList}">
        <tr onmouseover="changeColor(this)" onmouseout="changeColor1(this)">
            <td>${n.id}</td>
            <td>${n.email}</td>
            <td>${n.amount}</td>
            <td><c:if test="${n.status == 0}" >未付款</c:if><c:if test="${n.status == 1}" >已付款</c:if></td>
            <td>${n.orderdate}</td>
            <td>
                <c:if test="${n.status == 0}" >
                    <a href="javaScript:checkDel('${n.id}')">删除</a>
                </c:if>
                &nbsp;
            </td>
        </tr>
        </c:forEach>
    </table>
</body>
</html>